{extend name="public/base"}
{block name='main'}

<style type="text/css">
  .red {color: #FF5722!important;}
  .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
  <legend>{$menuid|getmenuname}</legend>
</fieldset>
<div class="my-btn-box">
    <span class="fr">
        <a class="layui-btn layui-btn-danger" id="btn-alldel">批量删除</a>
        <a href="{:url('page/add')}" class="layui-btn layui-btn-normal" id="btn-add">添加单页</a>
    </span>
</div>

<form class="layui-form layui-form-pane" action="">
  <table class="layui-table">
    <colgroup>
      <col width="60">
      <col width="60">
      <col width="">
      <col width="100">
      <col width="100">
      <col width="100">
    </colgroup>
    <thead>
    <tr>
      <th><input type="checkbox" id="checkall_t" lay-skin="primary" lay-filter="allChoose" ></th>
      <th>ID</th>
      <th>单页名称</th>
      <th>排序</th>
      <th>状态</th>
      <th>管理操作</th>
    </tr>
    </thead>
    <tbody id="userList">
    {volist name="list" id="val" }
      <tr>
        <td><input class="doc_checkbox" type="checkbox" value="{$val.id}" lay-skin="primary" lay-filter="itemChoose"></td>
        <td>{$val.id}</td>
        <td>{$val.title}</td>
        <td>{$val.ordid}</td>
        <td>
          <input type="checkbox" name="status" value="{$val.status}" data-uri="{:url('page/ajax_edit',array('field'=>'status','id'=>$val['id']))}" lay-skin="switch" lay-filter="status" lay-text="启用|禁止" {if ($val.status == 1)}checked{/if} >
        <td>
          <a href="{:url('page/edit', array('id'=>$val['id']))}" >编辑</a> |
          <a href="javascript:void(0);" class="J_confirmurl" data-uri="{:url('page/delete', array('id'=>$val['id']))}" data-msg="{:sprintf('确定要删除“”吗？',$val['name'])}" id="delete">删除</a></td>

        </td>
      </tr>
    {/volist}
    </tbody>

  </table>
</form>
<div id="test-laypage-demo0">
  <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-29">
    {$list|raw}
  </div>
</div>
<script>
  layui.use(['layer','jquery','form','element','table'], function () {
    //参数：layui、名称、模块名、主键（删除用）
    //新增弹窗
    Oper.config.add.width = '600px';
    Oper.config.add.height = '510px';

    //编辑弹窗
    Oper.config.edit.width = '600px';
    Oper.config.edit.height = '510px';
    Oper.initList(layui, '单页', 'page', 'id');
  });
</script>
{/block}